<script setup>
import ImgView from './imgview.vue'
import Voice from './audio.vue'
import VideoView from './videoview.vue'
const props = defineProps({
    msg: Object
})
</script>

<template>
    <div class="c-webrtc-refrence" @contextmenu.stop>
        <div>{{ msg.name }}:</div>
        <div>
            <div v-if="msg.type==='text'">{{ msg.text }}</div>
            <div v-else-if="msg.type==='image'">
                <ImgView :src="msg.url"/>
            </div>
            <div v-else-if="msg.type==='other'">
                <a :href="msg.url" :download="msg.fileName" target="_blank">{{ msg.fileName }}</a>
            </div>
            <div v-else-if="msg.type==='voice'">
                <Voice :url="msg.url" :time="msg.time" :size="true"/>
            </div>
            <div v-else-if="msg.type==='video'">
                <VideoView :url="msg.url"/>
            </div>
        </div>
    </div>
</template>